import {FileInfo} from "@shared/models/FileInfo";
import {Permission, PermissionDetail} from "@shared/models/Permission";
import {UserPublicInfo} from "@shared/models/UserInfo";
import {PmMessage} from "@shared/models/PmMessage";
import {UploadFileTask} from "@shared/models/UploadFileTask";
import {OfflineTask} from "@shared/models/OfflineTask";

export class TestData{
  permission = new Permission()


  static pmReq:PmMessage[] = [
    {
      id:'asadadad',
      from:'623de41c36e7e045ad4238fd',
      to:'623de41c36e7e045ad4238fd',
      fileIds:[''],
      fromName:'ben1',
      message:'您好，我想要您的以下文件的相应权限，希望您能给予方便！',
      detail:new PermissionDetail(),
      date:new Date(2021, 12, 1).toString()
    },
    {
      id:'623de41c36e7e045ad4238fd',
      from:'623de41c36e7e045ad4238fd',
      to:'623de41c36e7e045ad4238fd',
      fileIds:['623de41c36e7e045ad4238fd'],
      fromName:'',
      message:'您好，我想要您的以下文件的相应权限，希望您能给予方便！',
      detail:new PermissionDetail(),
      date:new Date(2021, 12, 1).toString()
    },
    {
      id:'623de41c36e7e045ad4238fd',
      from:'623de41c36e7e045ad4238fd',
      to:'623de41c36e7e045ad4238fd',
      fileIds:[''],
      fromName:'ben1',
      message:'您好，我想要您的以下文件的相应权限，希望您能给予方便！',
      detail:new PermissionDetail(),
      date:new Date(2021, 12, 1).toString()
    }
  ];
  constructor() {
    this.permission.open=true;
    this.permission.ann.open=true;
    this.permission.user.open=true;
    this.permission.custom.open=true;
  }
  static userPublicInfos: UserPublicInfo[] = [
    {
      username:'bby',
      userId:'623de41c36e7e045ad4238fd'
    },
    {
      username:'bby',
      userId:'623de41c36e7e045ad4238fd'
    },
    {
      username:'bby',
      userId:'623de41c36e7e045ad4238fd'
    },
    {
      username:'bby',
      userId:'623de41c36e7e045ad4238fd'
    },
    {
      username:'bby',
      userId:'623de41c36e7e045ad4238fd'
    },
    {
      username:'bby',
      userId:'623de41c36e7e045ad4238fd'
    },
    {
      username:'bby',
      userId:'623de41c36e7e045ad4238fd'
    },
    {
      username:'bby',
      userId:'623de41c36e7e045ad4238fd'
    },
    {
      username:'bby',
      userId:'623de41c36e7e045ad4238fd'
    },
    {
      username:'bby',
      userId:'623de41c36e7e045ad4238fd'
    },
    {
      username:'bby',
      userId:'623de41c36e7e045ad4238fd'
    },
    {
      username:'bby',
      userId:'623de41c36e7e045ad4238fd'
    }
  ];
  static root: Array<FileInfo> = [
    {
      id: 'asadsdfsafdsf',
      owner: '623de41c36e7e045ad4238fd',
      maker: 'string',
      name: 'Mark.md',
      type: 'text',
      isFile:true,
      parent: 'string',
      createTime: 'string',
      lastModified: new Date(1990, 12, 1).toString(),
      size: 21034,
      md5: 'string',
      checked:false
    },
    {
      id: 'DASFaSF',
      owner: '623de41c36e7e045ad4238fd',
      maker: 'string',
      name: '123.txt',
      isFile:true,
      type: 'text',
      parent: 'string',
      createTime: 'string',
      lastModified: new Date(2021, 3, 21).toString(),
      size: 123,
      md5: 'string',
      permission: new TestData().permission,
      checked:false
    },
    {
      id: 'sCAFGghbh',
      owner: '623de41c36e7e045ad4238fd',
      name: '测试文件夹1',
      maker: 'string',
      isFile:false,
      type: 'dir',
      parent: 'string',
      checked:false,
      createTime: 'string',
      lastModified: new Date(2020, 2, 11).toString(),
    },
  ];
  static dir1: Array<FileInfo> = [
    {
      id: 'asadsdfsafdsf',
      owner: 'string',
      checked:false,
      maker: 'string',
      name: '213.txt',
      type: 'text',
      parent: 'string',
      isFile:true,
      createTime: 'string',
      lastModified: new Date(1990, 12, 1).toString(),
      size: 210434,
      md5: 'string',
    },
    {
      id: 'DASFaSF',
      owner: 'string',
      maker: 'string',
      checked:false,
      name: 'saDF.zip',
      isFile:true,
      type: 'zip',
      parent: 'string',
      createTime: 'string',
      lastModified: new Date(2021, 3, 21).toString(),
      size: 1233254,
      md5: 'string',
    }
  ];
  static offline:OfflineTask[]=[
    {
      id:'62724ed97f06d753057c0491',
      userId:'623de41c36e7e045ad4238fd',
      file:TestData.root[0],
      url:'http://localhost:8003/download/direct/62433005619ff07f073c419c?directId=95747fc4-f177-4b69-b058-f1db95fc39c1',
      status:'success',
      progress:100
    },
    {
      id:'62724ed97f06d753057c0491',
      userId:'623de41c36e7e045ad4238fd',
      file:TestData.root[1],
      url:'http://localhost:8003/download/direct/62433005619ff07f073c419c?directId=95747fc4-f177-4b69-b058-f1db95fc39c1',
      status:'running',
      progress:56,
      finished:561
    },
    {
      id:'62724ed97f06d753057c0491',
      userId:'623de41c36e7e045ad4238fd',
      file:TestData.dir1[1],
      url:'http://localhost:8003/download/direct/62433005619ff07f073c419c?directId=95747fc4-f177-4b69-b058-f1db95fc39c1',
      status:'fail',
      progress:55,
      finished:3445
    },
    {
      id:'62724ed97f06d753057c0491',
      userId:'623de41c36e7e045ad4238fd',
      file:TestData.dir1[0],
      url:'http://localhost:8003/download/direct/62433005619ff07f073c419c?directId=95747fc4-f177-4b69-b058-f1db95fc39c1',
      status:'prepare',
      progress:0,
      finished:1234
    },
  ]
  static getUploadList() {
    let list:UploadFileTask[]=[]
    let item = new UploadFileTask("");
    item.guid='aslaxdd'
    item.name='文件1.txt'
    item.size=293809;
    item.status='active'
    item.ready=true
    item.finished=1233
    item.progress=20
    list.push(item)
    list.push(item)
    list.push(item)
    list.push(item)
    return list;
  }
}
